package com.hsh.erp.controller;

import com.hsh.erp.domain.common.Result;
import com.hsh.erp.domain.dto.InboundDTO;
import com.hsh.erp.domain.vo.InboundVO;
import com.hsh.erp.service.InboundService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author USER
 * @description 针对表【inbound】的数据库操作Service实现
 * @createDate 2024-05-30 16:21:43
 */
@RestController
@RequestMapping("/inbound")
@Tag(name = "入库记录", description = "入库记录")
public class InboundController {

    @Resource
    private InboundService inboundService;

    /**
     * 列表查询
     *
     * @param inboundVO
     * @return
     */
    @GetMapping("/list")
    @Operation(summary = "列表查询")
    public Result<List<InboundDTO>> getList(InboundVO inboundVO) {
        return inboundService.getList(inboundVO);
    }

    /**
     * 修改一条记录
     *
     * @param inboundVO *
     * @return
     */
    @PostMapping("/updateOne")
    @Operation(summary = "修改一条记录")
    public Result updateOne(@RequestBody InboundVO inboundVO) {
        return inboundService.updateOne(inboundVO);
    }

    /**
     * 删除一条记录
     *
     * @param inboundVO
     * @return
     */
    @PostMapping("/deleteOne")
    @Operation(summary = "删除一条记录")
    public Result deleteOne(@RequestBody InboundVO inboundVO) {
        return inboundService.deleteOne(inboundVO);
    }

    /**
     * 新增一条记录
     *
     * @param inboundVO
     * @return
     */
    @PostMapping("/addOne")
    @Operation(summary = "新增一条记录")
    public Result addOne(@RequestBody InboundVO inboundVO) {
        return inboundService.addOne(inboundVO);
    }

    /**
     * 批量新增记录
     *
     * @param inboundVOList
     * @return
     */
    @PostMapping("/addList")
    @Operation(summary = "批量新增记录")
    public Result addList(@RequestBody List<InboundVO> inboundVOList) {
        return inboundService.addList(inboundVOList);
    }

}




